package com.twu.biblioteca;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class BibliotecaApp {

    private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    private static Library library = new Library();

    public static void main(String[] args) {
        Customer customer = null;
        System.out.println(WelcomeMsg());
        try {
            System.out.print("Login: ");
            String username = br.readLine();
            System.out.print("Password: ");
            String password = br.readLine();
            customer = library.UserLogin(username,password);

        } catch (IOException e) {
            e.printStackTrace();
        }

        Menu menu = new MainMenu(library,customer);

        while(true) {
            menu.ShowMenu();
            menu.MenuAction(menu.MenuSelect());
        }
    }

    public static String WelcomeMsg() {
        return "Welcome to Biblioteca";
    }
}
